package com.hexb.smh.entity.param.account;

import com.hexb.smh.utils.IPasswordIn;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * @author : hexb
 * 首次登录设置密码
 */
@Data
public class ActivePasswordParam implements IPasswordIn {

    @ApiModelProperty(value = "新密码(6-20位字母/数字/符号)", example = "123321")
    @NotNull
    @Size(min = 6)
    private String newPassword;

    @ApiModelProperty(value = "密码是否需要加密(RSA算法)", example = "true")
    private Boolean encrypt;

    @ApiModelProperty(hidden = true)
    @Override
    public String getPassword() {
        return newPassword;
    }
}
